package com.example.java10;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.stream.Stream;

public class TestVar {

    public static void main(String[] args) throws FileNotFoundException {

        // 推断字符串
        var str = "土匪";

        // 推断long
        var age = 1000L;

        // 推断boolean
        var flag = true;

        // 推断ArrayList
        var list = new ArrayList<>();

        // 推断Stream
        var stram = Stream.of("哦哦", "嗯嗯", "嘿嘿");

        // for中的推断
        for(var i = 0; i < 1; i++){}

        // try中的推断
        try(var in = new FileInputStream("a.txt")){

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

}
